/**
 * [getURLParameters description]
 * @param   url can be null
 * @return     json object
 */
function getURLParameters(url) {
    url = url == null ? window.location.href : url;
    let parameterString = url.substring(url.lastIndexOf("?") + 1);
    let reg = /([^?&=]+)=([^?&=]*)/g;
    let params = {};
    parameterString.replace(reg, (result, $1, $2) => {
        params[decodeURIComponent($1)] = decodeURIComponent($2);
        return result;
    });
    return params;
}